use std::process::Command;

#[cfg(target_os = "linux")]
pub fn apktoold(path: String) {
    let out: std::process::Output = Command::new("res/apktoolLinux")
        .arg("d")
        .arg(path)
        .arg("-o")
        .arg("outapk")
        .arg("-f")
        .output()
        .expect("sh exec error!");
    let output_str = String::from_utf8_lossy(&out.stdout);
    println!("{:#?}", output_str);
}

#[cfg(target_os = "windows")]
pub fn apktoold(path: String) {
    println!("windows");
    Command::new("cmd")
        .arg("/c")
        .arg(cmd_str)
        .output()
        .expect("cmd exec error!")
}

#[cfg(target_os = "linux")]
pub fn apktoolbuild() {
    let out = Command::new("res/apktoolLinux")
        .arg("b")
        .arg("outapk")
        .arg("-o")
        .arg("out.apk")
        .output()
        .expect("sh exec error!");
    let output_str = String::from_utf8_lossy(&out.stdout);
    // println!("linux APK 路径--->{:#?}", path);
    println!("linux 编译 APK {:#?}", output_str.to_string());
}
